<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>$vo['name']))}
	<div class="operate-panel">
		<a onclick="go_return_url();" class="btn">返回</a>
		<if condition="$auth->admin">
			<a onclick="del()"class="btn btn-del">删除</a>
		</if>
		<div class="split"></div>
		<a onclick="winprint()" class="btn  hidden-xs">打印</a>
		<if condition="$auth->write">
			<a id="btn_edit" class="btn">修改</a>
		</if>
	</div>
	<div class="frame">
		<form method='post' id="form_content" name="form_content" enctype="multipart/form-data"   >
			<input type="hidden" id="id" name="id" value="{$vo.id}">
			<div class="frame">
				<div class="box col-12">
					
						<label class="input-label" >产品名称：</label>
						
							<p class="input-static">
								{$vo.name}
							</p>
						</div>
					</div>
				</div>
				<div class="box col-12">
					
						<label class="input-label" >产品编码：</label>
						
							<p class="input-static">
								{$vo.doc_no}
							</p>
						</div>
					</div>
				</div>
			</div>
			<div class="frame">
				<div class="box col-12">
					
						<label class="input-label" >登录人：</label>
						
							<p class="input-static">
								{$vo.user_name}
							</p>
						</div>
					</div>
				</div>
				<div class="box col-12">
					
						<label class="input-label" >登录日期：</label>
						
							<p class="input-static">
								{$vo.create_time|to_date='Y-m-d H:i'}
							</p>
						</div>
					</div>
				</div>
			</div>
			<div class="frame">
				<foreach name="field_list" val="field_vo">
					{:widget('UserDefineField/view',array($field_vo))}
				</foreach>
			</div>
			<div class="frame">
				<div class="box col-12">
					
						<label class="input-label" >描述：</label>
						
							<div class="input-static">
								{$vo.content}
							</div>
						</div>
					</div>
				</div>
				<div class="box col-12">
					
						<label class="input-label" for="name">附件：</label>
						
							{:widget('file_upload/view',array('add_file'=>$vo['add_file'],'mode'=>'show'))}
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global'], function() {
			var $ = layui.jquery;

			var layer = layui.layer;
			//保存后关闭
			$('#btn_save').on('click', function() {
				send_form('form_data', '{:url("save")}', '', function(ret) {
					if (ret.status == 1) {
						parent.layer.msg(ret.info);
						parent.layer.close(index);
						parent.location.reload(true);
					} else {
						parent.layer.msg(ret.info);
						return false;
					}
				});
			});

			//关闭iframe
			$('#btn_close').click(function() {
				parent.layer.close(index);
			});

			$('#btn_select_pid').on('click', function() {
				winopen("{:url('winpop')}", 560, 470);
			});
			$("#btn_edit").click(function() {
				window.open(fix_url("{:url('edit')}?id=" + $("#id").val()), "_self");
			});
			$("#btn_del").click(function() {
				layer.msg('确定要删除吗?', {
					time : 0,
					btn : ['确定', '取消'],
					yes : function(index) {
						var vars = $("#form_data").serialize();
						send_ajax("{:url('del')}", 'id=' + $("#id").val(), function(data) {
							if (data.status) {
								ui_alert(data.info, function() {
									go_return_url();
								});
							}
						});
					},
					no : function(index) {
						layer.close(index);
					}
				});
			});
		});

	</script>
</block>